type Person07281<T> = {
  // {username : string, password : string}
  // in 后面只能跟着一个联合类型 :  'username' |  'password'
  [P in keyof T]?: T[P];
};

// 将T里面所有的属性都变成可选项
// 1. 循环每一项 2. 修改成可选项 in
type InPerson = Person07281<{ username: string; password: string }>;

type ReadonlyPerson<T> = {
  readonly [P in keyof T]: T[P];
};
const person: ReadonlyPerson<{ username: string; password: string }> = {
  username: "123",
  password: "124",
};
// person.password = '123'


// 将一个Person07281类型中 所有的key 都变成只读
